<include file="Public/header"/>
    <div class="row">
        <div class="layui-tab">
            <ul class="layui-tab-title">
                <li class="" data-url="<{:U('User/usermoney',['userid'=>$info[id]])}>" onclick="load_url(this)">今日明细</li>
                <li class="layui-this" data-url="<{:U('User/incrMoney',['uid'=>$info[id]])}>" onclick="load_url(this)">加/减余额</li>
                <li class="" data-url="<{:U('User/frozenTiming',['uid'=>$info[id],'tradeType'=>'t1'])}>" onclick="load_url(this)">T1资金解冻</li>
                <li class="" data-url="<{:U('User/frozenTiming',['uid'=>$info[id],'tradeType'=>'d1'])}>" onclick="load_url(this)">D1资金解冻</li>
                <li class="" data-url="<{:U('User/frozenMoney',['uid'=>$info[id]])}>" onclick="load_url(this)">解冻金额</li>
            </ul>
            <div class="layui-tab-content">
                <div class="layui-tab-item layui-show">
                    <form class="layui-form" action="" id="incr">
                        <input type="hidden" name="uid" value="<{$info['id']}>">
                        <div class="layui-form-item">
                            <div class="layui-inline">
                                <label class="layui-form-label">可用余额：</label>
                                <div class="layui-input-inline">
                                    <input type="tel" autocomplete="off" class="layui-input" value="<{$info.balance}>">
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-inline">
                                <label class="layui-form-label">冻结余额：</label>
                                <div class="layui-input-inline">
                                    <input type="tel" autocomplete="off" class="layui-input" value="<{$info.blockedbalance}>">
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-inline">
                                <label class="layui-form-label">操作：</label>
                                <div class="layui-input-inline">
                                    <input type="radio" name="cztype" value="3" title="增加金额" checked="">
                                    <input type="radio" name="cztype" value="4" title="减少金额">
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-inline">
                                <label class="layui-form-label">变动金额：</label>
                                <div class="layui-input-inline">
                                    <input type="tel" name="bgmoney" lay-verify="required" autocomplete="off" class="layui-input">
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-inline">
                                <label class="layui-form-label">备注：</label>
                                <div class="layui-input-inline">
                                    <textarea placeholder="请输入内容" name="memo" lay-verify="required" class="layui-textarea"></textarea>
                                </div>
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <div class="layui-inline">
                                <label class="layui-form-label"></label>
                                <button class="layui-btn" lay-submit="submit" lay-filter="save">立即提交</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
<include file="Public/footer"/>
<script>
    layui.use(['layer', 'form'], function(){
        var form = layui.form
            ,layer = layui.layer;
        //监听提交
        form.on('submit(save)', function(data){
            $.ajax({
                url:"<{:U('User/incrMoney')}>",
                type:"post",
                data:$('#incr').serialize(),
                success:function(res){
                    if(res.status){
                        layer.alert("编辑成功", {icon: 6},function () {
                            parent.location.reload();
                            var index = parent.layer.getFrameIndex(window.name);
                            parent.layer.close(index);
                        });
                    }else{
                        layer.alert(reg.msg?reg.msg:"操作失败", {icon: 5},function () {
                            parent.location.reload();
                            var index = parent.layer.getFrameIndex(window.name);
                            parent.layer.close(index);
                        });
                    }
                }
            });
            return false;
        });
    });

    function load_url(url) {
        var url = $(url).data('url');
        location.href = url;
    }

</script>
</body>
</html>
